<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateExperimentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('experiments', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('user_id')->unsigned()->index('user_id');
			$table->string('experiment_name');
			$table->integer('experiment_type')->unsigned()->index('experiment_type');
			$table->text('experiment_outline');
			$table->string('home');
			$table->string('experiment_manual');
			$table->integer('design_type')->unsigned()->index('design_type');
			$table->integer('compare_type')->unsigned()->index('compare_type');
			$table->integer('complete_status')->unsigned()->index('complete_status');
			$table->integer('status')->unsigned()->index('status');
			$table->timestamps();


			$table->foreign('user_id')->references('user_id')->on('users');
			$table->foreign('experiment_type')->references('id')->on('experiment_types');
			$table->foreign('design_type')->references('id')->on('design_types');
			$table->foreign('compare_type')->references('id')->on('compare_types');
			$table->foreign('status')->references('id')->on('status');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('experiments');
	}

}
